﻿package Player
{
	import BasicEngine.MsgId;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.events.MouseEvent;
	import flash.geom.Matrix;
	//具有可见性的实体
	public class VisualProc extends BaseProc
	{
		public static var Instance:VisualProc = new VisualProc();
		
		public function VisualProc()
		{
		}
		
		public override function Update(_msg:MsgId):void
		{
			if (_msg.AcceptID > 0)  // 不等于 -1,不等于0   //个体消息
			{
				var data:VisualEntData = DataCenter.GetData(_msg.AcceptID);    			
			}
			else    //全局消息
			{
			    //trace("个体全局消息");
			}
		}
		
		public function SwitchImg(_msg:MsgId):void
		{
			if (_msg.AcceptID > 0)
			{
				var data:VisualEntData = DataCenter.GetData(_msg.AcceptID);
				if (data != null)
				{
					var index:int = (int)(_msg.Data);
				    data.Current = index;
				    data.Img.bitmapData = data.BmpdataFrames[data.Current];
				}				
			}
		}
		
		public function RotateImg(_msg:MsgId):void
		{
			if (_msg.AcceptID > 0)
			{
				var data:VisualEntData = DataCenter.GetData(_msg.AcceptID);
				if (data != null)
				{
					var angle:int = (int)(_msg.Data);
				    data.Img.rotation = angle;
				}				
			}
		}
		
		public function MouseDown(_e:MouseEvent,_data:VisualEntData):void
		{
			
		}
		
		public function MouseUp(_e:MouseEvent, _data:VisualEntData):void
		{
			
		}
		
		public function MouseOver(_e:MouseEvent, _data:VisualEntData):void
		{
			
		}
		
		
	}
}